import {BaseModel} from "@/model/BaseModel";

export class QueueScheduleModel extends BaseModel{

    public id: string;

    public departId: string;

    public departCode: string;

    public departName: string;

    public itemId: string;

    public itemCode: string;

    public itemName: string;

    public doctorId: string;

    public doctorCode: string;

    public doctorName: string;

    public categoryId: string;

    public categoryCode: string;

    public categoryName: string;

    public scheduleDate: string;

    public scheduleWeek: string;

    public flowFlag: number;

    public clinicHoursId: number;

    public clinicHoursName: string;

    public awaitCount: number;

    public static WeekArrMap: {label: string, value: number}[] = [
        {label: "周一", value: 1},
        {label: "周二", value: 2},
        {label: "周三", value: 3},
        {label: "周四", value: 4},
        {label: "周五", value: 5},
        {label: "周六", value: 6},
        {label: "周日", value: 7},
    ]

    public static clinicHoursIdArrMap: {label: string, value: number}[] = [
        {label: "", value: 0},
        {label: "上午", value: 1},
        {label: "午间", value: 2},
        {label: "下午", value: 3},
        {label: "晚间", value: 4},
        {label: "全天", value: 5},
    ]


    public static getWeek(val: number) {
        return this.WeekArrMap.find(item => item.value == val)
    }

    public getClinicHours() {
        return QueueScheduleModel.clinicHoursIdArrMap.find(item => item.value == this.clinicHoursId)
    }

    public _emplLevelName: string;

    public _emplAbility: string;

    // 记录老的时段值
    public _clinicHoursId: number;

    public isChanged() {
        return this._clinicHoursId != this.clinicHoursId
    }

    public deserialize?(input: any): this {
        Object.assign(this, input);
        this._clinicHoursId = this.clinicHoursId
        return this;
    }
}